package com.sneakxy.cloudbase.platform.bean;

import java.io.Serializable;

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;

import com.sneakxy.mybatis.commons.annotations.Column;
import com.sneakxy.mybatis.commons.annotations.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 首页信息
 * @author 徐英
 * @see
 */
@Data
@Table("t_cb_home")
@EqualsAndHashCode(callSuper = false)
public class Home extends BaseEntity<Home.HomeId> implements TimeEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2961994177777882889L;
	
	/**
	 * 复合主键
	 */
	@Id
	private HomeId id;
	/**
	 * 模板内容
	 */
	@Column("template")
	private String template;

	/**
	 * 创建时间
	 */
	@Column("createtime")
	private String createtime;

	/**
	 * 更新时间
	 */
	@Column("updatetime")
	private String updatetime;
	
	@Transient
	private boolean isNew;
	
	@Override
	public boolean isNew() {
		return isNew;
	}

	@Override
	public void setNew(boolean isNew) {
		this.isNew = isNew;
	}
	
	/**
	 * 复合主键
	 */
	@Data
	@EqualsAndHashCode
	public static class HomeId implements Serializable {
		
		/**
		 * 
		 */
		private static final long serialVersionUID = -8586727774554968926L;

		public HomeId() {}
		
		public HomeId(String type, Boolean login) {
			this.type = type;
			this.login = login;
		}
		
		/**
		 * 菜单类型
		 */
		@Column("type")
		private String type;

		/**
		 * 是否登录:0、未登录，1、登录
		 */
		@Column("login")
		private Boolean login;

	}

}
